﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyBanHang_NewApp.BUS;
using QuanLyBanHang_NewApp.Entity;


namespace QuanLyBanHang_NewApp
{
    public partial class FormLogIn : Form
    {
        NhanVienBUS nv_bus;
        
        
        public FormLogIn()
        {
            InitializeComponent();
            
            nv_bus = new NhanVienBUS();
        }

       
        private void button_login_Click(object sender, EventArgs e)
        {
            NhanVien nvien = nv_bus.VerifyUser(textBox_tk.Text, textBox_mk.Text);
            if (nvien != null)
            {
                FormMain frm_main = new FormMain(nvien, this);
                textBox_tk.Clear();
                textBox_mk.Clear();
                this.Hide();
                frm_main.Show();

            }

        }

        private void Form_LogIn_Load(object sender, EventArgs e)
        {

        }

        private void button_exit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }
    }
}
